<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
</body>
<script>
    $(function () {
        var msg = {
            username: "小明",
            password: "123"
        };

        $.ajax({
            type: 'POST',
            contentType: 'application/json',
            data: JSON.stringify(msg),
            url: 'requestBody',
            success: function (result) {
                alert(result.result)
            }
        })
    })
</script>

</html>
